package com.business.business.service.impl;

import com.business.business.entity.OepreStore;
import com.business.business.repository.OepreStoreRepository;
import com.business.business.service.OePreStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;
import java.util.List;

@Service
public class OepreStoreServiceImpl implements OePreStoreService {

    @Autowired
    OepreStoreRepository oepreStoreRepository;


    @Override
    public List<OepreStore> findOepreStoreByVouserid(int id) {
        return oepreStoreRepository.findOepreStoreByVoUseridOrderByFlagDesc(id);
    }

    @Transactional
    @Override
    public OepreStore saveOepreStore(OepreStore oepreStore) {
        return oepreStoreRepository.save(oepreStore);
    }
}
